package cz.vutbr.fit.xzemko01.tfmcbs.validation.validators;

import java.util.Map;

import org.eclipse.emf.common.util.DiagnosticChain;

import cz.vutbr.fit.xzemko01.tfmcbs.model.Element;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Relationship;

public final class RelationshipValidator implements Validator<Relationship> {
	
	private static RelationshipValidator relationshipValidator;
	
	private Validator<Element> elementValidator;
	
	private RelationshipValidator() {
		elementValidator = ElementValidator.getInstance();
	}
	
	public static Validator<Relationship> getInstance() {
		if(relationshipValidator == null) {
			relationshipValidator = new RelationshipValidator();
		}
		return relationshipValidator;
	}
	
	@Override
	public boolean validate(Relationship relationship, DiagnosticChain diagnostics, Map<Object, Object> context) {
		return elementValidator.validate(relationship, diagnostics, context);
	}	
}
